
import com.jme3.app.state.AppStateManager;
import com.jme3.asset.AssetManager;
import com.jme3.bullet.BulletAppState;
import com.jme3.light.DirectionalLight;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;

/**
 *
 * @author David Zhang
 */
public class Game{
    AppStateManager stateManager;
    Node rootNode, player;
    AssetManager assetManager;
    BulletAppState bulletAppState;
    
    public Game(boolean chat, AppStateManager stateManager, Node rootNode, AssetManager assetManager, BulletAppState bulletAppState){
        this.rootNode = rootNode;
        this.assetManager = assetManager;
        Gui.nifty.gotoScreen("chat");
        initSky();
        initPlayer();
        initCam();
        initBullets();
        initKeys();
        if (chat) initChat();
    }

    private void initSky() {
        //Main.class.rootNode.attachChild(SkyFactory.createSky(assetManager, assetManager.loadTexture("Textures/Sky/Space/West.jpg"), assetManager.loadTexture("Textures/Sky/Space/East.jpg"), assetManager.loadTexture("Textures/Sky/Space/North.jpg"), assetManager.loadTexture("Textures/Sky/Space/South.jpg"), assetManager.loadTexture("Textures/Sky/Space/Up.jpg"), assetManager.loadTexture("Textures/Sky/Space/Down.jpg")));
    }

    private void initPlayer() {
        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-0.1f, -1f, -1).normalizeLocal());
        rootNode.addLight(dl);
        System.out.println("preadd");
        player = (Node) assetManager.loadModel("Models/enemy/enemy.j3o");
        System.out.println("postadd");
        player.setLocalScale(0.5f);
        rootNode.attachChild(player);
    }

    private void initCam() {
        System.out.println("cam");
    }

    private void initBullets() {
        System.out.println("bulllet");
    }

    private void initKeys() {
        System.out.println("keys");
    }

    private void initChat() {
        System.out.println("chat");
    }
}